/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package co.edu.unitecnologica.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author osalcedo
 */
@Embeddable
public class EstudiantesPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id")
    private String id;
    @Basic(optional = false)
    @Column(name = "cod_programa")
    private int codPrograma;

    public EstudiantesPK() {
    }

    public EstudiantesPK(String id, int codPrograma) {
        this.id = id;
        this.codPrograma = codPrograma;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getCodPrograma() {
        return codPrograma;
    }

    public void setCodPrograma(int codPrograma) {
        this.codPrograma = codPrograma;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        hash += (int) codPrograma;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstudiantesPK)) {
            return false;
        }
        EstudiantesPK other = (EstudiantesPK) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        if (this.codPrograma != other.codPrograma) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.unitecnologica.modelo.EstudiantesPK[id=" + id + ", codPrograma=" + codPrograma + "]";
    }

}
